from flask import Blueprint, jsonify
from app.hardware.relay_controller import relay_controller

api_bp = Blueprint('api', __name__, url_prefix='/api/v1')

@api_bp.route('/health', methods=['GET'])
def health_check():
    """健康检查"""
    return jsonify({
        'status': 'healthy',
        'service': 'raspberry-relay-control'
    })

@api_bp.route('/system/info', methods=['GET'])
def system_info():
    """系统信息"""
    return jsonify({
        'gpio_pins': list(relay_controller.relays.keys()),
        'total_relays': len(relay_controller.relays)
    })